package it.poste.il.compensatore.entities;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.SequenceGenerator;

import org.springframework.beans.factory.annotation.Autowired;

import java.io.Serializable;

/**
 * Superclasse per tutte le classi
 */
@MappedSuperclass
public class BaseEntity implements Serializable {
    
	private static final long serialVersionUID = 2885380808345282365L;
	
//	@Autowired
//	@SequenceGenerator(name = "sequence", allocationSize = 1, sequenceName = "COMP_ID_SEQ")
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public boolean isNew() {
        return (id == null);
    }
}
